import { FormPage } from "custom/index";
import { addEmployeeManagement, getEmployeeManagementDetail, updateEmployeeManagement } from '../api'
import { sexOptions, onDutyStatusOptions, becomeRegularStatusOptions } from '../constant'
import dayjs from 'dayjs'

const page = new FormPage('EmployeeManagementAdd');

page
  .getApi(getEmployeeManagementDetail)
  // .addApi(addEmployeeManagement)
  // .editApi(updateEmployeeManagement)
  .useGroup('基本信息')
    .useDatePicker('entryDate').label('入职日期').setProp('disabled', true).setDefault(dayjs().format('YYYY-MM-DD')).required().end()
    .useItem('name').label('姓名').required().end()
    .useItem('flowerName').label('花名').required().end()
    .useSelect('sex', sexOptions).label('性别').required().end()
    .useItem('mobile').label('手机号码').required().end() 
    .useItem('no').label('工号').required().end()
    // .useDictSelect('deptNo', 6).label('部门').setProp('widthLabel', 'deptName').required().end()
    // .useDictSelect('postNo', 7).label('岗位').setProp('widthLabel', 'pestName').required().end()
    .useSelect('onDutyStatus', onDutyStatusOptions).label('在职状态').required().end()
    .useSelect('becomeRegularStatus', becomeRegularStatusOptions).label('转正状态').required().end()
    .useItem('password').label(' 登录系统密码').setProp('disabled', false).end()
    .useDictSelect('companyNo', 'company').label('公司').setProp('widthLabel', 'companyName').required().end()

export default page
